Copy, Link, Read Only Script

Has anyone developed a script that copies selected objects from source to target module, links the target objects to the source and sets access to read only. This is a requirements reuse implementation scheme that I read in a paper. Thought I'd ask around before I go and write it. There are bits of this in the Tools/Functions/Copy Objects but it doesn't support selected objects and doesn't set RO access.
gbt_l3 - Tue May 08 11:27:50 EDT 2012

Re: Copy, Link, Read Only Script
SystemAdmin - Tue May 08 20:29:51 EDT 2012

"....There are bits of this in the Tools/Functions/Copy Objects but it doesn't support selected objects and doesn't set RO access..."

Whilst the "Copy Objects" function doesn't set RO access, it can work to selected objects - it's just that you need to use a filter to display your selection and then use the "Current Display Set" option from the "Copy" drop down box.

If your selection is a contiguous selection where you have used the SHIFT key to select a range of adjacent objects, then use the DXL code below to filter only on that selection (This snippet of code comes from the "Filter" range of DXL Kitchen scripts).

 

 

filtering off
Object o
for o in current Module do {
 
    if ( isSelected o ) accept o
        else reject o
}
filtering on



If your selection needs to be non-contiguous, DOORS doesn't support the CTRL convention for selecting non adjacent items, so you either need to dream up a filter that will display these non contiguous objects or maybe tag each object using an attribute and then filter on whatever tag you have used to display your non contiguous selection. I find the built-in "Object Short Text" attribute good for this sort of thing as it's rarely used for anything important.

As for Read-Only access - does this work for you? Set up the Target module with access rights that only allows members of a specific group to perform this operation (RMCD or just RMC rights), everyone else outside of that group can then be set to Read-only.



 

 

 


Paul Miller
Melbourne, Australia

 

Re: Copy, Link, Read Only Script
M_vdLaan - Wed May 09 06:12:38 EDT 2012

Hi,

Yes, I have done this, almost exactly as you describe. A reuse system for individual objects from a central repository.

A user interface allows you to choose the source module from the library, then you can select the individual objects (or hierarchies) you want to import to your project and the system would copy them and link back to the original objects. Using a custom 'suspect link' mechanism, it iss possible to also determine when objects have been changes in the central library, so you can decide whether you want to update the project side.

The system allowed certain attributes to be changed (such as comments, rationale, priority, status, etc, which are all project specific) while locking others (e.g. Object Text and Object Short Text).

Unfortunately, this was done for a client and I cannot share the code... But it is possible.

Good luck!

Marcel